/*     */ package com.lmpop.trade.ti_emaillist;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Ti_emaillistInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_emaillistInfo()
/*     */   {
/*  17 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  26 */     Ti_emaillist ti_emaillist = new Ti_emaillist();
/*  27 */     ti_emaillist.setSend_id(map.getString("send_id"));
/*  28 */     ti_emaillist.setCust_id(map.getString("cust_id"));
/*  29 */     ti_emaillist.setSend_state(map.getString("send_state"));
/*  30 */     ti_emaillist.setIs_repeat(map.getString("is_repeat"));
/*  31 */     ti_emaillist.setTitle(map.getString("title"));
/*  32 */     ti_emaillist.setContent(map.getString("content"));
/*  33 */     ti_emaillist.setPre_date(map.getString("pre_date"));
/*  34 */     ti_emaillist.setSend_date(map.getString("send_date"));
/*  35 */     ti_emaillist.setUser_id(map.getString("user_id"));
/*  36 */     ti_emaillist.setRemark(map.getString("remark"));
/*     */ 
/*  38 */     String result_code = "0";
/*     */     try {
/*  40 */       insert(dbmMgr, ti_emaillist);
/*     */     } catch (ApplicationException e) {
/*  42 */       e.printStackTrace();
/*  43 */       result_code = "1";
/*     */     }
/*  45 */     map.setString("result_code", result_code);
/*  46 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_emaillist ti_emaillist)
/*     */     throws ApplicationException
/*     */   {
/*  55 */     dbmMgr.update("insertTi_emaillist", ti_emaillist);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  65 */     String pkid_string = map.getString("pkid");
/*  66 */     String result_code = "0";
/*     */     try {
/*  68 */       if (!pkid_string.equals("")) {
/*  69 */         String[] pkStr = pkid_string.split("\\|");
/*  70 */         for (int i = 0; i < pkStr.length; i++) {
/*  71 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  75 */       e.printStackTrace();
/*  76 */       result_code = "1";
/*     */     }
/*  78 */     map.setString("result_code", result_code);
/*  79 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  88 */     dbmMgr.update("deleteTi_emaillist", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  97 */     Ti_emaillist ti_emaillist = new Ti_emaillist();
/*  98 */     ti_emaillist.setSend_id(map.getString("send_id"));
/*  99 */     ti_emaillist.setCust_id(map.getString("cust_id"));
/* 100 */     ti_emaillist.setSend_state(map.getString("send_state"));
/* 101 */     ti_emaillist.setIs_repeat(map.getString("is_repeat"));
/* 102 */     ti_emaillist.setTitle(map.getString("title"));
/* 103 */     ti_emaillist.setContent(map.getString("content"));
/* 104 */     ti_emaillist.setPre_date(map.getString("pre_date"));
/* 105 */     ti_emaillist.setSend_date(map.getString("send_date"));
/* 106 */     ti_emaillist.setUser_id(map.getString("user_id"));
/* 107 */     ti_emaillist.setRemark(map.getString("remark"));
/*     */ 
/* 109 */     String result_code = "0";
/*     */     try {
/* 111 */       update(dbmMgr, ti_emaillist);
/*     */     } catch (ApplicationException e) {
/* 113 */       e.printStackTrace();
/* 114 */       result_code = "1";
/*     */     }
/* 116 */     map.setString("result_code", result_code);
/* 117 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_emaillist ti_emaillist)
/*     */     throws ApplicationException
/*     */   {
/* 126 */     dbmMgr.update("updateTi_emaillist", ti_emaillist);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 136 */     Map ti_emaillist = (Hashtable)obj;
/* 137 */     if (start == 0)
/* 138 */       start = 0;
/*     */     else {
/* 140 */       start = (start - 1) * limit;
/*     */     }
/* 142 */     ti_emaillist.put("start", Integer.valueOf(start));
/* 143 */     ti_emaillist.put("limit", Integer.valueOf(limit));
/*     */ 
/* 146 */     return this.queryList.getList("selTi_emailList", ti_emaillist);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 157 */     Map ti_emaillist = (Hashtable)obj;
/*     */ 
/* 160 */     List list = this.queryList.getList("selTi_emailSum", ti_emaillist);
/* 161 */     int count = 0;
/* 162 */     if ((list != null) && (list.size() > 0)) {
/* 163 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 164 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 165 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 168 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 178 */     return this.queryList.getList("getTi_emaillistByPk", pk);
/*     */   }
/*     */ 
/*     */   public List taskScheduler(Object obj)
/*     */   {
/* 183 */     Map taskSchedulerMap = (Hashtable)obj;
/* 184 */     Map params = new Hashtable();
/*     */ 
/* 186 */     String start_date = "";
/* 187 */     String end_date = "";
/* 188 */     String current_date = "";
/*     */ 
/* 190 */     if ((taskSchedulerMap.size() > 0) && (taskSchedulerMap != null))
/*     */     {
/* 192 */       if (taskSchedulerMap.get("start_date") != null) {
/* 193 */         start_date = taskSchedulerMap.get("start_date").toString();
/*     */       }
/* 195 */       if (taskSchedulerMap.get("end_date") != null) {
/* 196 */         end_date = taskSchedulerMap.get("end_date").toString();
/*     */       }
/* 198 */       if (taskSchedulerMap.get("Current") != null) {
/* 199 */         current_date = taskSchedulerMap.get("Current").toString();
/*     */       }
/*     */ 
/*     */     }
/*     */ 
/* 205 */     if ((start_date != null) && (!start_date.equals("")))
/*     */     {
/* 207 */       params.put("start_date", start_date);
/*     */     }
/*     */ 
/* 211 */     if ((current_date != null) && (!current_date.equals("")))
/*     */     {
/* 213 */       params.put("current_date", current_date);
/*     */     }
/*     */ 
/* 217 */     if ((end_date != null) && (!end_date.equals("")))
/*     */     {
/* 219 */       params.put("end_date", end_date);
/*     */     }
/*     */ 
/* 222 */     return this.queryList.getList("taskScheduler_SendEmail", params);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_emaillist.Ti_emaillistInfo
 * JD-Core Version:    0.6.0
 */